package com.xx.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class BaseEntity {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "创建人")
    @TableField("create_by")
    private String createBy;
    @Schema(description = "创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @Schema(description = "修改人")
    @TableField("modified_by")
    private String modifiedBy;
    @Schema(description = "修改时间")
    @TableField(value = "modified_time",fill= FieldFill.UPDATE)
    private LocalDateTime modifiedTime;
    @Schema(description = "逻辑删除 逻辑删除:0=未删除,1=已删除")
    @TableField("deleted")
    private Integer deleted;

    @TableField(value = "version",fill = FieldFill.INSERT)
    @Version
    private Integer version;
}
